package com.ylbh.modules.shopping_orderform.controller;

import com.ylbh.common.pojo.goodsorder.dto.ExternalOrderDTO;
import com.ylbh.common.pojo.goodsorder.vo.ExternalOrderVO;
import com.ylbh.common.utils.CommonResult;
import com.ylbh.common.utils.PageUtils;
import com.ylbh.common.utils.Ref;
import com.ylbh.modules.shopping_orderform.entity.ShoppingForeignOrder;
import com.ylbh.modules.shopping_orderform.service.ShoppingForeignOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author wuj
 * @email 869993955@qq.com
 * @date 2020-01-07
 */
@RestController
@RequestMapping("external")
public class ShoppingExternalOrderController {

    @Autowired
    private ShoppingForeignOrderService shoppingForeignOrderService;
    @RequestMapping("queryExternalOrderList")
    public CommonResult<PageUtils> queryExternalOrderList(@RequestParam Map<String, Object> params) {
        PageUtils pageList = shoppingForeignOrderService.queryExternalOrderList(params);
        return Ref.ok(pageList);
    }

    @GetMapping("queryExternalOrderById/{id}")
    public CommonResult queryExternalOrderById (@PathVariable String id) {
        ExternalOrderVO vo = shoppingForeignOrderService.queryExternalOrderById(id);
        return Ref.ok(vo);
    }
}
